package com.zhiyou.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import com.zhiyou.model.Fy_Qsen;
import com.zhiyou.service.Fy_QsenService;
import com.zhiyou.utils.JsonResult;

@RestController
@RequestMapping("qsen/")
public class Fy_QsenController {
@Autowired
Fy_QsenService fy_QsenService;
	@PostMapping("addFy_Qsen")
	public void addFy_Qsen(Fy_Qsen fy_Qsen,MultipartFile[] files,HttpServletRequest req,HttpServletResponse rep){
	fy_QsenService.addFy_Qsen(fy_Qsen, files);
	}
	@PostMapping("updateFy_Qsen")
	public void updateFy_Qsen(Fy_Qsen fy_Qsen,MultipartFile[] files,HttpServletRequest req,HttpServletResponse rep){
	fy_QsenService.updateFy_Qsen(fy_Qsen, files);
	}
	@GetMapping("deleteFy_Qsen/{qsen_id}")
	public void deleteFy_Qsen(@PathVariable("qsen_id")Integer qsen_id,HttpServletRequest req,HttpServletResponse rep){
	fy_QsenService.deleteFy_Qsen(qsen_id);
	}
	@GetMapping("selectAllFy_Qsen/{qsen_type}")
	public JsonResult selectAllFy_Qsen(@PathVariable("qsen_type")Integer qsen_type,HttpServletRequest req,HttpServletResponse rep){	
	return new JsonResult(fy_QsenService.selectAllFy_Qsen(qsen_type),"查询成功");
	}
	@GetMapping("selectFy_QsenByID/{qsen_id}")
	public JsonResult selectFy_QsenByID(@PathVariable("qsen_id")Integer qsen_id,HttpServletRequest req,HttpServletResponse rep){	
	return new JsonResult(fy_QsenService.selectFy_QsenByID(qsen_id),"查询成功");
	}
	@GetMapping("selectFy_Qsen")
	public JsonResult selectFy_Qsen(HttpServletRequest req,HttpServletResponse rep){	
	return new JsonResult(fy_QsenService.selectFy_Qsen(),"查询成功");
	}
}
